How many times has Congress and the President tweeted about COVID-19?
How positive and negative is the content of the tweets?
Here is a list of the top 20 positive or negative words for each party and the President.
Here is a list of the top 10 positive or negative words for each party and the President by week.
What are Congress and the President saying about COVID-19?
Here are 100 the most frequently used words by each party and the President.
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 21202 |
| republicans | 18955 |
| trump | 208 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 1917 |
| republicans | 1112 |
| trump | 24 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 19285 |
| republicans | 17843 |
| trump | 184 |
Here are 50 the most frequently used words by each party and the President for each week in February and March.
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 199 |
| republicans | 133 |
| trump | 2 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 176 |
| republicans | 162 |
| trump | 1 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 103 |
| republicans | 80 |
| trump | 1 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 1222 |
| republicans | 682 |
| trump | 19 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 2580 |
| republicans | 2801 |
| trump | 24 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 5437 |
| republicans | 4171 |
| trump | 55 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 9627 |
| republicans | 9459 |
| trump | 82 |
p$data %>%
filter(party %in% c("democrats", "republicans", "trump")) %>%
group_by(party) %>%
summarize(`number of tweets` = n()) %>%
kable(format = "pandoc")| party | number of tweets |
|---|---|
| democrats | 1858 |
| republicans | 1467 |
| trump | 24 |
Who’s tweeting the most and what are they tweeting?
tweets %>%
filter(!is.na(party)) %>%
group_by(state_name, title, first, last, twitter_handle, party, gender, ethnicity) %>%
summarize(n = n()) %>%
arrange(desc(n)) %>%
ungroup() %>%
rename("state" = state_name,
"twitter handle" = twitter_handle) %>%
mutate(state = as.factor(state),
title = as.factor(title),
party = as.factor(party),
gender = as.factor(gender),
ethnicity = as.factor(ethnicity)) %>%
DT::datatable(filter = "top", rownames = FALSE)tweets %>%
filter(!is.na(party)) %>%
select(state_name, title, first, last, twitter_handle, party, gender, ethnicity, day, text) %>%
arrange(twitter_handle) %>%
unnest_tokens(word, text) %>%
group_by(state_name, title, first, last, twitter_handle, party, gender, ethnicity) %>%
count(word, sort = TRUE) %>%
anti_join(stop_words, by = "word") %>%
filter(!grepl(ignore_root_words, word)) %>%
filter(!word %in% ignore_words) %>%
ungroup() %>%
rename("state" = state_name,
"twitter handle" = twitter_handle) %>%
mutate(state = as.factor(state),
title = as.factor(title),
party = as.factor(party),
gender = as.factor(gender),
ethnicity = as.factor(ethnicity)) %>%
DT::datatable(filter = "top", rownames = FALSE)